package com.sushi.controller;

import com.sushi.service.GameService;
import com.sushi.response.ResponseBO;
import com.sushi.response.ResponsePageBO;
import com.sushi.response.GameResp;
import com.sushi.request.GameReq;
import com.sushi.request.GamePageReq;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.*;

/**
 * 游戏 控制器
 * @date 2023-05-02
 * @time 17:14:28
 * @author Administrator
 */
@RestController
@Slf4j
public class GameController {

	@Autowired
	private GameService gameService;

    

    /**
     * 新增
     */
    @PostMapping("/game/add")
    public ResponseBO<GameResp> add(@RequestBody GameReq req) {
        return gameService.add(req);
    }

    /**
     * 逻辑删除
     */
    @PostMapping("/game/remove")
    public ResponseBO<GameResp> remove(@RequestBody GameReq req) {
        return gameService.logicRemove(req);
    }

    /**
     * 更新
     */
    @PostMapping("/game/update")
    public ResponseBO<GameResp> update(@RequestBody GameReq req) {
        return gameService.updateByField(req);
    }

    /**
     * 列表
     */
    @PostMapping("/game/list")
    public ResponsePageBO<GameResp> list(@RequestBody GamePageReq req) {
        return gameService.listByCondition(req);
    }

    /**
     * 详情
     */
    @PostMapping("/game/detail")
    public ResponseBO<GameResp> detail(@RequestBody GameReq req) {
        return gameService.detail(req);
    };

}